package practice2;

import java.util.Scanner;

public class P8635 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double sqrt = Math.sqrt(n);
        int a,b,c,d;
        boolean flag = false;
        for(a=0;a<=sqrt;a++){
            for(b=a;b<=sqrt;b++){
                for(c=b;c<=sqrt;c++){
                    for(d=c;d<=sqrt;d++){
                        if(a*a+b*b+c*c+d*d == n){
                            System.out.println(a+" "+b+" "+c+" "+d);
                            return;
                        }
                    }
                }
            }
        }
    }
}
